package com.cai.baselibrary.arouter

import android.provider.SyncStateContract
import com.alibaba.android.arouter.facade.Postcard
import com.alibaba.android.arouter.facade.callback.NavigationCallback
import com.alibaba.android.arouter.launcher.ARouter
import com.blankj.utilcode.util.LogUtils
import com.cai.baselibrary.Constants

class LoginNavigationCallbackImpl : NavigationCallback {

    /**找到了*/
    override fun onFound(postcard: Postcard?) {

    }

    /**找不到了*/
    override fun onLost(postcard: Postcard?) {

    }

    /**跳转成功了*/
    override fun onArrival(postcard: Postcard?) {

    }

    override fun onInterrupt(postcard: Postcard?) {
        postcard?.let {
            val path = it.path
            LogUtils.v(path)
            val bundle = it.extras
            // 被登录拦截了下来了
            // 需要调转到登录页面，把参数跟被登录拦截下来的路径传递给登录页面，登录成功后再进行跳转被拦截的页面
            ARouter.getInstance().build(ARouterPath.ACTIVITY_LOGIN)//跳转登录
                .with(bundle)
                .withString(Constants.PATH_AROUTER, path)
                .navigation();

        }











    }
}